<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/backup.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_submit; ?></span></a><a href="<?=$back?>" class="button"><span><?php echo $button_back; ?></span></a></div>
    </div>
    <div class="content">
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="form">
          <tr>
            <td><?php echo $entry_email; ?></td>
            <td><input type="text" name="email" value="<?=$email?>" />
              <?php if ($error_email) { ?>
              <span class="error"><?php echo $error_email; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><?php echo $entry_surveys; ?></td>
            <td><div class="scrollbox">
                <?php $class = 'odd'; ?>
                <?php foreach ($surveys as $survey) { ?>
                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                <div class="<?php echo $class; ?>">
                  <?php if (in_array($survey['survey_id'], $survey_ides)) { ?>
                  <input type="checkbox" name="survey_ides[]" value="<?php echo $survey['survey_id']; ?>" checked="checked" />
                  <?php echo $survey['title']; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="survey_ides[]" value="<?php echo $survey['survey_id']; ?>" />
                  <?php echo $survey['title']; ?>
                  <?php } ?>
                </div>
                <?php } ?>
              </div>
              <a onclick="$(this).parent().find(':checkbox').attr('checked', true);"><?php echo $text_select_all; ?></a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);"><?php echo $text_unselect_all; ?></a>
              <?php if ($error_survey_ides) { ?>
              <span class="error"><?php echo $error_survey_ides; ?></span>
              <?php } ?>
              </td>              
          </tr>
        </table>
      </form>
      <?php if(count($processed) > 0) {?>
      <table class="" cellpadding="3">
      	<?php foreach ($processed as $survey) { ?>
      	<tr>
      		<td>&nbsp;</td>
      	</tr>
      	<tr>
      		<th style="text-align:left;font-size:16px;color:green;"><?=$survey['name'];?> (<?=$text_user?>)</th>
     	</tr>
      	<tr>
      		<td style="border-top:1px solid lightgray;font-size:12px;"><?=$survey['output'];?></td>
      	</tr>
      	<?php } ?>
      </table>
      <?php } ?>
    </div>
  </div>
</div>
<?php echo $footer; ?>